package qwqw;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.TimerTask;

/**
* A task to send e-mails to a list of people who have 
* to return a book tomorrow
*/
public final class ScheduledTask extends TimerTask {
	mysqlConnection db;
	ResultSet rs = null;
	Connection conn;
  public ScheduledTask(){
	  
  }
  
  public void run(){	
	  try 
		{
       Class.forName("com.mysql.jdbc.Driver").newInstance();
      
   } catch (Exception ex) {/* handle the error*/}
   
   try 
   {
	   
	   	 conn = DriverManager.getConnection("jdbc:mysql://localhost/obl","root","Braude");
       	 Statement stmt;
       	 stmt=conn.createStatement();
       	 db = new mysqlConnection(stmt);  
       	 
       	System.out.println("Sending Emails...");   
     //  db.onceADayEmailQuerry();
       conn.close();
		
       
   } catch (SQLException ex) 
	    {/* handle any errors*/
       System.out.println("SQLException: " + ex.getMessage());
       System.out.println("SQLState: " + ex.getSQLState());
       System.out.println("VendorError: " + ex.getErrorCode());
       
   }
    
  }

}